
     window.onload=function(){
      var value=0;
      var reduce = document.getElementsByClassName("reduce")[0] ;
      var add = document.getElementsByClassName("add")[0] ;
      console.log(reduce); 
      console.log(add); 
      reduce.onclick=function(){
         if(value<=1){
             value=1;
         }
         console.log(value);
         var className = "box"+value;
         var target = document.getElementsByClassName(className)[0];
         console.log(target);
         target.style.display="none";
         value--;

      }
      add.onclick=function(){
         value++;
        if(value>=7){
            value=7;
        }
       console.log(value)
        var className = "box"+value;
        var target = document.getElementsByClassName(className)[0];
        console.log(target);
        target.style.display="block";
     }
       
    }